﻿Public Class Padrao
    Inherits System.Web.UI.Page
    Dim erro1 As String
    Dim erro2 As String
    Dim erro3 As String
    Dim util As New Util

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then
            Try
               
                Dim paginavisivel As Boolean
                paginavisivel = util.validarpagina(0)
                If Not paginavisivel Then
                    FormsAuthentication.SignOut()
                    Response.Redirect(ResolveUrl("~/Login.aspx"))
                End If
                pnl1.Visible = False

                erro1 = Request.QueryString("erro1")
                erro2 = Request.QueryString("erro2")
                erro3 = Request.QueryString("erro3")
                If erro1 <> "" Then
                    pnl1.Visible = True
                    imgintexclamacao.ImageUrl = "~/img/sub_blue_delete.png"
                    Throw New Exception("Cadastro Excluido Com Sucesso")
                End If

                If erro2 <> "" Then
                    imgintexclamacao.ImageUrl = "~/img/sub_blue_add.png"
                    Throw New Exception("Cadastro Efetuado com Sucesso")
                End If

                If erro3 <> "" Then
                    imgintexclamacao.ImageUrl = "~/img/pencil.png"
                    Throw New Exception("Cadastro Alterado com Sucesso")
                End If

            Catch ex As Exception
                pnl1.Visible = True
                lblerro.Text = ex.Message
            End Try
        End If
    End Sub

End Class